<?php
class VisitCount extends MY_Controller {
	public function __construct(){
		parent::__construct();
		$this->theme->set_module('visitCount');
		$this->load->library('OnlineUsers');
		$this->load->library('visit_counter');
	}
	
	public function get(){
		$data['visit_data'] = $this->visit_counter->getVisitCounter();
		$data['visit_counter'] = $this->visit_counter->getAllVisit();
		$data['user_online'] = $this->onlineusers->total_users();
		return $data;
	}

	public function setVisit($visit_type = 'guests') {
		$this->visit_counter->view($visit_type);
		return true;
	}
}